function updateYCR(crossing){
        $("#chart").html("");
        var tid= document.getElementById("testid");
        var chart= document.getElementById("chart");
	var iChildren = [];
        var cbf = function(limsresp){
                //alert("calling callback:" + limsresp + " build json, update div then draw");
                var ypgarray = limsresp.response.docs;
                for (var yindex in ypgarray){
			var ypgjson = {};
			var ypg = ypgarray[yindex];
			ypgjson["name"] = ypg["ypgKey"];
			ypgjson["size"] = 2000;
			iChildren.push(ypgjson);
                }
		iJson["name"] = crossing; //translate later
		iJson["children"] = iChildren;
                draw();
        };
        var ycrurl = "/solr/select/?q=ypgFields:" + crossing + "&wt=json&rows=10&fl=ypgKey";
        $.get(ycrurl, "", cbf, "json");
}

if (!vq)
    var vq = {};

/**
 * @namespace - the parent class for utility classes focused on visualization tools.
 */
if (!vq.utils)
    vq.utils = {};


vq.utils.GoogleDSUtils = {};

    /**     Converts any DataTable object into an array of JSON objects, each object consisting of a single row in the
     *      DataTable.  The property label is obtained from the getColumnLabel() function of the google.visualiztion.DataTable class.
     *
     *      Column types listed as a 'number' are passed in as numeric data.  All other data types are passed in as strings.
     *
     *      The returned JSON array conforms to the common input format of Protovis visualizations.
     *
     * @param googleDataTable - google.visualizations.DataTable object returned by a google datasource query
     * @return data_array - JSON array.
     */

vq.utils.GoogleDSUtils.dataTableToArray = function(googleDataTable) {
        var table = googleDataTable,
        data_array=[],
        headers_array=[],
        column_type=[];
        if (table == null) { return [];}
        for (col=0; col<table.getNumberOfColumns(); col++){
            headers_array.push(table.getColumnLabel(col));
            column_type.push(table.getColumnType(col));
        }


        for (row=0; row<table.getNumberOfRows(); row++){
            var temp_hash={};
            for (col=0; col<table.getNumberOfColumns(); col++){
                if(column_type[col].toLowerCase() == 'number') {
                    temp_hash[headers_array[col]]=table.getValue(row,col);
                } else {
                    temp_hash[headers_array[col]]=table.getFormattedValue(row,col);
                }
            }
            data_array.push(temp_hash);
        }
        return data_array;
    };

